package com.atguigu.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author 孙志鹏
 * @createDate 2022/3/30 15:03
 */
@Configuration
public class ApplicationContextConfig {

    /**
     * Rest风格接口调用工具
     * @return
     */
    @Bean
    // @LoadBalanced // 添加RestTemplate负载均衡机制
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
